package com.huahua.api.controller;

import com.huahua.api.entity.base.R;
import com.huahua.api.entity.param.RandomCharacterParam;
import com.huahua.api.service.RandomCharacterService;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LoveHuaHua
 * @date 2023年08月19日 21:58
 * @description believe in yourself
 */
@RestController
@RequestMapping("/random")
@RequiredArgsConstructor(onConstructor = @__(@Lazy))
public class RandomCharacterController {
    private final RandomCharacterService randomCharacterService;


    /**
     * 随机字符生成器
     *
     * @param param 参数
     * @return {@link Object}
     */
    @PostMapping("/character")
    private Object randomCharacter(@RequestBody RandomCharacterParam param){
        String generate = randomCharacterService.generate(param);
        return R.success(generate);
    }
}
